<template>
  <div>
    <h1>我是List</h1>
    <h5>我是List的{{ count }}</h5>
    <button @click="LookMovie">点击查看电影列表</button>
    <ul>
      <li v-for="item in movie" :key="item.tvId">
        {{ item.albumName }}
      </li>
    </ul>
    <ul>
      <li v-for="item in getterChange" :key="item.tvId">
        {{ item.albumName }}
      </li>
    </ul>
    <hr />
    <ul>
      <li v-for="item in getterChangeN" :key="item.tvId">
        {{ item.albumName }}
      </li>
    </ul>
  </div>
</template>

<script>
import { mapActions, mapGetters, mapState } from "vuex";
export default {
  name: "List",
  computed: {
    ...mapState("count", ["count"]),
    ...mapState("count", ["movie"]),
    //拿到派生数据
    ...mapGetters("count", ["getterChange"]),
    getterChangeN() {
      return this.$store.getters["count/getterChangeN"]({ n: 5, m: 7 });
    },
  },
  methods: {
    ...mapActions("count", ["LookMovie"]),
  },
};
</script>

<style>
</style>